function Bookmarks_keywordsService() { }

Bookmarks_keywordsService.prototype = {
    /**
     * ブックマーク_キーワード中間テーブル作成SQL
     * @return string
     */
    createBookmarks_keywordSQL: function(){
        return 'CREATE TABLE IF NOT EXISTS bookmarks_keywords ('+
            'bookmark_id INTEGER NOT NULL, ' + 
            'keyword_id INTEGER NOT NULL ' + 
        ')';
    },
    
    getAddKeysSql: function() {
        return "INSERT INTO bookmarks_keywords VALUES (?, ?)";
    },
    
    getDeleteKeysSql: function(bmid, keysid) {
        var joken = '';
        for (var i = 0; i < keysid.length; i ++) {
            if (i !=0 ) {
               joken += ' OR ';  
            }
            joken += 'keyword_id=' + keysid[i];
            
        }
        
        return "DELETE FROM bookmarks_keywords WHERE bookmark_id=" + bmid + " AND (" + joken + ")";
    }
};
